package 线程的状态;

import java.util.concurrent.TimeUnit;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: sfx
 * Date: 2022-11-18
 * Time: 9:42
 */
public class TimeUnit1 {

    //更好地可读性-->sleep
    public static void main(String[] args) {
        System.out.println(System.currentTimeMillis() + "sleeping...");
        try {
            TimeUnit.SECONDS.sleep(1);//睡眠1s钟-->更好地可读性
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(System.currentTimeMillis() + "running...");
    }
}
